namespace CSharpPro._0922_1;

public class Demo1
{
    static void Main()
    {
       demo2 IsLeapYear = new demo2();
        Console.WriteLine("请输入一个年份：");
        string input = Console.ReadLine();

       
        if (int.TryParse(input, out int year))
        {
            bool isLeapYear =IsLeapYear.IsLeapYear(year);

            if (isLeapYear)
            {
                Console.WriteLine($"{year}年是闰年");
            }
            else
            {
                Console.WriteLine($"{year}年不是闰年");
            }
        }
        else
        {
            Console.WriteLine("输入无效，请输入一个有效的年份");
        }
    }
}
